<?php

require_once __DIR__ . '/vendor/autoload.php';

$container = new App\Container\Container;

//$container->set('config', function(){
//	return new App\Config\Config;
//});

//$container->share('config', function (){
//    return new App\Config\Config;
//});


//$container->share('database', function($container){
//  //  dump($container);
//    return new App\Database\Database($container->config);
//});

//dump($container->config->get('app.name'));
//dump($container->config->get('app.name'));
//dump($container->config->get('app.name'));
//dump($container->config->get('app.name'));

//$container->get('database');
//dump($container->database->connect());

//dump((new \App\Controllers\HomeController($container->config, $container->database))->index());

$container->share(\App\Database\Database::class, function ($container){
   return new App\Database\Database($container->get(\App\Config\Config::class));
});

//dump((new \App\Controllers\HomeController($container->get(\App\Config\Config::class),
  //  $container->get(\App\Database\Database::class)))->index());

  dump($container->get(\App\Controllers\HomeController::class)->index());